# To excute:
# ?> cat readnplot.r | rloc --slave &
#
#load(".RData")
# Load functions
source("../readf.r")
source("../plotfunc.r")
source("../sigtest.r")

# Read in experiment output
print("Read in output....")
#n06.0301 <- read0301("par.06.0301.p2",nexp=10)
n06.0301 <- readf("par.06.0301",nexp=30)
n06.0401 <- readf("par.06.0401",nexp=30)
n06.0402 <- readf("par.06.0402",nexp=30)
n06.0403 <- readf("par.06.0403",nexp=30)
n06.0405 <- readf("par.06.0405",nexp=30)
n06.0406 <- readf("par.06.0406",nexp=30)
n06.0515 <- readf("par.06.0515",nexp=30)
n06.0516 <- readf("par.06.0516",nexp=30)
n06.0525 <- readf("par.06.0525",nexp=30)
n06.0526 <- readf("par.06.0526",nexp=30)
# organize data
print("Organize data")
rm(pn06.objf,pn06.ofc)
rm(pn06a.objf,pn06a.ofc)
pn06.objf <- list(at.as=n06.0301$objf, co.as=n06.0401$objf, co.ws=n06.0402$objf, co.ai=n06.0405$objf, co.wi=n06.0406$objf, co.mo=n06.0403$objf)
pn06.ofc <- list(at.as=n06.0301$ofc, co.as=n06.0401$ofc, co.ws=n06.0402$ofc, co.ai=n06.0405$ofc, co.wi=n06.0406$ofc, co.mo=n06.0403$ofc)
pn06a.objf <- list(as.ai=n06.0515$objf, as.wi=n06.0516$objf, ws.ai=n06.0525$objf, ws.wi=n06.0526$objf)
pn06a.ofc <- list(as.ai=n06.0515$ofc, as.wi=n06.0516$ofc, ws.ai=n06.0525$ofc, ws.wi=n06.0526$ofc)
print("")
# Plotting
ploti(pn06.objf, natp=64, nptp=16, ps=T, yrange=c(0.4,0.8))
plotco(pn06.ofc, natp=64, nptp=16, ps=T, yrange=c(-1,1))
# Clean up
#rm(n06.0301,n06.0401,n06.0402,n06.0403,n06.0405,n06.0406)
#rm(n06.0401,n06.0402,n06.0403,n06.0405,n06.0406)
# 
#quit(save="yes")
